package com.hr.剑指offer.work1;

/**
 * @author 周恒哲
 * @date 2020/06/16
 **/
public class 面试题17_打印从1到最大的n位数 {
    public static int[] printNumbers(int n) {
        int end = (int)Math.pow(10, n) - 1;
        int[] res=new int[end];
        for (int i = 0; i < end; i++) {
            res[i]=i+1;
        }
        return res;
    }

    public static void main(String[] args) {
        for (int i = 0; i < 面试题17_打印从1到最大的n位数.printNumbers(3).length; i++) {
            System.out.println(i+1);
        }
    }
}
